package com.itheima.service.impl;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripDao;
import com.itheima.service.TripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author stay foolish
 * @description 行至水穷处, 坐看云起时
 * @date 2022/11/24 17:57:47
 * @description TODD
 */
@Service
public class TripServiceImpl implements TripService {
    @Autowired
    private TripDao tripDao;
    @Override
    public List<Trip> findAllTrip() {
        List<Trip> list = tripDao.findAllTrip();
        return list;
    }

    public Trip findTripById(int id) {
        Trip trip = tripDao.findTripById(id);
        return trip;
    }

    @Override
    public void updateTripById(Trip trip) {
        tripDao.updateTripById(trip);
    }

    @Override
    public void deleteTripById(int id) {
tripDao.deleteTripById(id);
    }

    @Override
    public void addTrip(Trip trip) {
        tripDao.addTrip(trip);

    }


}
